home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / JPNL Libraries / Streams.java < prev    next >
Text File  |  1996-05-23  |  318b  |  19 lines

  1. package au.com.peter.libraries;
  2.  
  3. import java.io.*;
  4.  
  5. public class Streams {
  6.  
  7.     public static void CopyStream( InputStream in, OutputStream out ) throws IOException {
  8.         byte[] data = new byte[2048];
  9.         int c;
  10.         
  11.         do {
  12.             c = in.read( data );
  13.             if ( c > 0 ) {
  14.                 out.write( data, 0, c );
  15.             }
  16.         } while ( c >= 0 );
  17.     }
  18. }
  19.